module TeamsHelper
  
  ##
  # displays the full name of the manager and makes it a clickable link
  # to the team page that will display all of the owners
  def manager_column(record)
    '<b>' + link_to(record.person.full_name_and_username, :controller => "teams", :id => record.id, :action => "show" )    + '</b>'
  end
  
  ##
  # displays the full name of a person any time it is displayed
  def person_column(record)
    '<b>' + record.person.full_name_and_username + '</b>'
  end
  
  ##
  # Changes the display of the edit button for projections
  # based on the permissions of the logged in user 
  def projections_column(record)
    if record.project.is_logged_in_project_administrator?
      link_to("view/edit projections", :controller => "projections", :id => record.id, :action => "index_for_team" )
    else
      link_to("view projections", :controller => "projections", :id => record.id, :action => "index_for_team" )
    end
  end
  
  
end
